const configMobile = require('../mobile/config')
const configWeb = require('../web/config')
const configFramework = require('../framework/config')

module.exports = {
  base: '/',
  markdown: {
    lineNumbers: false,
  },
  themeConfig: {
    docsDir: 'docs',
    logo: '/logo.png',
    icon: '',
    sidebar: {
      ...configFramework.sidebar,
      ...configMobile.sidebar,
      ...configWeb.sidebar,
    },
    nav: [
      ...configFramework.navbar,
      ...configMobile.navbar,
      ...configWeb.navbar,
      {
        text: '第三方UI库',
        items: [
          { text: 'VantUI', link: 'https://vant-contrib.gitee.io/vant/#/zh-CN/' },
          { text: 'ElementUI', link: 'https://element.eleme.io/#/zh-CN' }
        ]
      },
    ]
  },
  // 解决import方式引入pdfh5报错的问题
  // ref: https://github.com/vuejs/vuepress/issues/790#issuecomment-418107492
  head: [
    [
      'link',
      { href: '/icon.png', rel: 'icon' }
    ],
    [
      'link',
      { href: '/css/pdfh5.css', rel: 'stylesheet' }
    ],
    [
      'script',
      { src: '/js/pdf.js', type: 'text/javascript', charset: 'utf-8' }
    ],
    [
      'script',
      { src: '/js/pdf.worker.js', type: 'text/javascript', charset: 'utf-8' }
    ],
    [
      'script',
      { src: '/js/jquery-2.1.1.min.js', type: 'text/javascript', charset: 'utf-8' }
    ],
    [
      'script',
      { src: '/js/pdfh5.js', type: 'text/javascript', charset: 'utf-8' }
    ]
  ]
}